package com.fs.sw.pojo.audit;

import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import java.util.Date;

@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@Data
public abstract class AbstractAuditable {
    @Id
    @Column(name="id",nullable = false)
    private Integer id ;

    @CreatedDate
    @Column(name="create_date",nullable = false)
    private Date createDate;

    @LastModifiedDate
    @Column(name="Last_modified_date",nullable = false)
    private Date LastModifiedDate;
}
